package com.shuda.system.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;

import java.time.LocalDateTime;

/**
 * 用户角色关联实体类
 *
 * 移除 Lombok，提供显式 getter/setter，避免编译期方法缺失问题。
 */
@TableName("sys_user_role")
@Schema(description = "用户角色关联实体")
public class UserRoleEntity {

    @TableId(type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "角色ID")
    private Long roleId;

    @Schema(description = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "删除标记（0-未删除，1-已删除）")
    private Integer deleted;

    /** 获取主键ID */
    public Long getId() { return id; }
    /** 设置主键ID */
    public void setId(Long id) { this.id = id; }

    /** 获取用户ID */
    public Long getUserId() { return userId; }
    /** 设置用户ID */
    public void setUserId(Long userId) { this.userId = userId; }

    /** 获取角色ID */
    public Long getRoleId() { return roleId; }
    /** 设置角色ID */
    public void setRoleId(Long roleId) { this.roleId = roleId; }

    /** 获取创建人 */
    public String getCreateBy() { return createBy; }
    /** 设置创建人 */
    public void setCreateBy(String createBy) { this.createBy = createBy; }

    /** 获取创建时间 */
    public LocalDateTime getCreateTime() { return createTime; }
    /** 设置创建时间 */
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }

    /** 获取更新人 */
    public String getUpdateBy() { return updateBy; }
    /** 设置更新人 */
    public void setUpdateBy(String updateBy) { this.updateBy = updateBy; }

    /** 获取更新时间 */
    public LocalDateTime getUpdateTime() { return updateTime; }
    /** 设置更新时间 */
    public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; }

    /** 获取删除标记 */
    public Integer getDeleted() { return deleted; }
    /** 设置删除标记 */
    public void setDeleted(Integer deleted) { this.deleted = deleted; }
}